<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title></title>
    </head>
    <body>
        <script>
            var hosturl = "http://api.sogoodluck.com/prod-api";
            var url = location.search.substring(1);
            let Obj = {};
            if (url) {
                let s = url.split("&");
                s.forEach((item) => {
                    let kv = item.split("=");
                    if (kv.length) {
                        Obj[kv[0]] = kv[1];
                    }
                });
            }
            fetch(
                hosturl +
                    "/admin-api/tk/redirect/redirect-whatsapp?url=" +
                    Obj.url,
                {
                    linkUrl: Obj.url,
                }
            )
                .then((res) => res.json())
                .then((data) => {
                    if (data.code == 0) {
                        window.location.href = data.data;
                    }
                })
                .catch((err) => console.log(err));
        </script>
    </body>
</html>
